<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <input type="text" v-model="h" placeholder="身高">
    <input type="text" v-model="w" placeholder="体重">
    <input type="button" value="查询" @click="f()">
    <h2>身体健康:{{info}}</h2>
</div>


<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<!-- import Vue before Element -->
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<!-- import JavaScript -->
<script src="https://cdn.staticfile.org/element-ui/2.15.9/index.min.js"></script>
<script>
    let v = new Vue({
        el: 'body>div',
        data: {
            h: "",
            w: "",
            info: ""
        },
        methods: {
            f() {
                axios.get("/bmi?w=" + v.w + "&h=" + v.h).then(function (response) {
                    v.info = response.data
                })
            }
        }
    })
</script>

</body>
</html>